import React from 'react'
import { withRouter } from 'react-router-dom'

import './style.css'

class Commodity extends React.Component {
    toInfo = () => {
        const { history } = this.props
        history.push('/commodityInfo')
    }
    render() {
        return (
            <div 
                className='commodity'
                onClick={this.toInfo}
            >
                <dl >
                    <dt 
                        className='commodity-photo'
                        style={{ backgroundImage: 'url(https://xinglong.tech/logo.jpg)' }}
                    >
                    </dt>   
                    <dd className='commodity-name' >IT外包</dd>
                    <dd className='commodity-price'>¥ 99.99</dd>
                </dl>
            </div>
        )
    }
}


export default withRouter(Commodity)
